API - Cache\Memcache_driver
system\cache.php at line 837

Class Memcache_driver

Dynamic_cache_driver
└─Temporary_cache_driver
└─Memcache_driver

public class Memcache_driver
extends Temporary_cache_driver

Memcache distributed persistent cache driver implementation. Give it a higher priority if a cluster of webservers is used and Memcached is running via TCP/IP between them. In other circumstances this only should be used if no APC/XCache available, keeping in mind that File_cache might be still faster.
Author:
Cotonti Team

Field Summary
protected Memcache

$memcache

PHP Memcache instance

Constructor Summary
Memcache_driver

__construct(string host, int port, bool persistent)

Creates an object and establishes Memcached server connection

Method Summary
static string

createKey($key key)

Make unique key for one of different sites on one memcache pool

void

clear(str realm)

void

dec(string id, string realm, int value)

void

exists(mixed id, mixed realm)

void

get(mixed id, mixed realm)

array

get_info()

void

inc(string id, string realm, int value)

void

remove(mixed id, mixed realm)

bool

store(string id, mixed data, string realm, int ttl)

Methods inherited from API - Cache\Temporary_cache_driver
dec, get_info, get_ini_size, inc
Methods inherited from API - Cache\Dynamic_cache_driver
store

Field Detail

system\cache.php at line 843

memcache

protected Memcache $memcache = NULL
PHP Memcache instance

Constructor Detail

system\cache.php at line 852

__construct

public Memcache_driver __construct(string host, int port, bool persistent)
Creates an object and establishes Memcached server connection
Parameters:
host - Memcached host
port - Memcached port
persistent - Use persistent connection
Returns:

Method Detail

system\cache.php at line 865

createKey

public static string createKey($key key)
Make unique key for one of different sites on one memcache pool
Parameters:
Returns:

system\cache.php at line 873

clear

public void clear(str realm)
See Also:
Cache_driver::clear()

system\cache.php at line 889

dec

public void dec(string id, string realm, int value)
See Also:
Temporary_cache_driver::dec()
Parameters:
id - Counter identifier
realm - Realm name
value - Increment value return int Result value

system\cache.php at line 898

exists

public void exists(mixed id, mixed realm)
See Also:
Cache_driver::exists()

system\cache.php at line 907

get

public void get(mixed id, mixed realm)
See Also:
Cache_driver::get()

system\cache.php at line 916

get_info

public array get_info()
See Also:
Temporary_cache_driver::get_info()
Returns:
Associative array containing information

system\cache.php at line 929

inc

public void inc(string id, string realm, int value)
See Also:
Temporary_cache_driver::inc()
Parameters:
id - Counter identifier
realm - Realm name
value - Increment value return int Result value

system\cache.php at line 938

remove

public void remove(mixed id, mixed realm)
See Also:
Cache_driver::remove()

system\cache.php at line 947

store

public bool store(string id, mixed data, string realm, int ttl)
See Also:
Dynamic_cache_driver::store()
Parameters:
id - Object identifier
data - Object value
realm - Realm name
ttl - Time to live, 0 for unlimited
Returns: